Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Allow events to be created with no prev_events (MSC2716) #11243

Merged
merged 14 commits into from
Dec 11, 2021

Conversation

MadLittleMods
Copy link
Contributor

@MadLittleMods MadLittleMods commented Nov 3, 2021

Allow events to be created with no prev_events. The event still needs to have auth_events defined to be valid.

Split out from #11114

Dev notes

SYNAPSE_POSTGRES=1 SYNAPSE_TEST_LOG_LEVEL=INFO python -m twisted.trial tests.handlers.test_message.EventCreationTestCase

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
  • Pull request includes a sign off
  • Code style is correct
    (run the linters)

The event still needs to have auth_events defined to be valid.

Split out from #11114
@MadLittleMods MadLittleMods requested a review from a team as a code owner November 3, 2021 23:40
@MadLittleMods MadLittleMods added the T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. label Nov 3, 2021
@MadLittleMods MadLittleMods changed the title Allow events to be created with no prev_events Allow events to be created with no prev_events (MSC2716) Nov 3, 2021
Copy link
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have some tests for this, unless it's expected to be covered by matrix-org/complement#214?

synapse/handlers/message.py Outdated Show resolved Hide resolved
synapse/handlers/message.py Outdated Show resolved Hide resolved
changelog.d/11243.feature Outdated Show resolved Hide resolved
synapse/handlers/room_member.py Show resolved Hide resolved
MadLittleMods and others added 2 commits November 4, 2021 15:27
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
),
AssertionError,
)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have some tests for this, unless it's expected to be covered by matrix-org/complement#214?

All of the MSC2716 Complement tests cover this use case since we use it so much there. I've just added some integration tests for this.

I didn't add tests for every case to be completely exhaustive but did make sure this extra functionality works and that we don't allow events with empty auth_events

  • Creating a m.room.create event
    • ❌ In MSC2716 room version
    • ❌ In existing stable room version
  • Creating event with empty prev_event
    • ✅ In MSC2716 room version
    • ❌ In existing stable room version
  • Creating event with empty prev_event and empty auth_event (make sure rejected)
    • ✅ In MSC2716 room version
    • ❌ In existing stable room version
  • Creating event with prev_events
    • ❌ In MSC2716 room version
    • ❌ In existing stable room version
  • Creating event with prev_events but empty auth_event (make sure rejected)
    • ❌ In MSC2716 room version
    • ❌ In existing stable room version

Copy link
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tests! This lgtm, I'd like to just ask another member of the team to double-check the changes make sense (and don't have any security implications).

tests/handlers/test_message.py Outdated Show resolved Hide resolved
tests/handlers/test_message.py Outdated Show resolved Hide resolved
tests/handlers/test_message.py Show resolved Hide resolved
@anoadragon453 anoadragon453 requested a review from a team November 8, 2021 14:00
Previously just a copy paste

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
@@ -81,6 +81,8 @@ class RoomVersion:
msc2716_historical = attr.ib(type=bool)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tests! This lgtm, I'd like to just ask another member of the team to double-check the changes make sense (and don't have any security implications).

Thanks for the review @anoadragon453 🦈

Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise lgtm

synapse/handlers/message.py Outdated Show resolved Hide resolved
@anoadragon453
Copy link
Member

I've noticed that interestingly, we seem to have attempts to create events without prev_events all the time, which will now start going through: https://sentry.matrix.org/sentry/synapse-matrixorg/issues/200257/?query=is%3Aunresolved (link for those with access).

@richvdh
Copy link
Member

richvdh commented Nov 9, 2021

see #8094 for some background on that assertion.

I'm not enthusiastic about any change which makes it more likely for us to start accidentally creating regular events without prev_events, so +1 to the suggestion that we only allow this for insertion events.

> if `len(auth_event_ids) == 0` then `auth_event_ids` will be falsey, so the extra check is redundant.
>
> -- #11243 (comment)
builder.type == EventTypes.Create or len(prev_event_ids) > 0
), "Attempting to create an event with no prev_events"
room_version_obj = await self.store.get_room_version(builder.room_id)
if room_version_obj.msc2716_empty_prev_events:
Copy link
Contributor Author

@MadLittleMods MadLittleMods Nov 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be good, but will obviously not be backwards compatible. We probably want to add this to a new room version?

-- @erikjohnston

Does this actually require a new room version? (discussed at #11114 (comment))

My thinking is that this code is only for creating events, not accepting events. So technically any other homeserver nowadays can create events with no prev_events now and it would work in existing room versions.

Am I missing something?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not that surprised that we accept outliers with empty prev-events, but we'll need special handling for the insertion event to be accepted, i.e. we'll need some sort of check like "this is an insertion event so we need to go and fetch the state rather than trying to calculate it". Though that can be part of the history import MSC I guess

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll need special handling for the insertion event to be accepted, i.e. we'll need some sort of check like "this is an insertion event so we need to go and fetch the state rather than trying to calculate it"

Why is this the case? It seems to work in my Complement tests without any of this 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spooky! 👻 Is it doing something silly like dropping the event with no extremities and then doing a /state on the event that references it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure yet. If you really want me to dive into it, I can ⛳

@@ -918,6 +918,7 @@ async def create_new_client_event(
full_state_ids_at_event = None
if auth_event_ids is not None:
# If auth events are provided, prev events must be also.
# prev_event_ids could be an empty array though.
assert prev_event_ids is not None

# Copy the full auth state before it stripped down
Copy link
Contributor Author

@MadLittleMods MadLittleMods Nov 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separately: I'm not sure its correct that the insertion event points to anything else, as we need want federation to ask for the state at the insertion event, rather than any of the state events that it references?

-- @erikjohnston

The insertion event is connected to the state chain so the whole historical batch can share the same state_group, see #10975. It also looks nice in the DAG semantically to be able to see the state that authed the batch.

For the federation cases, it seems to work 🤔🤷. auth_event_ids probably

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that surprises me a bit. I was very much imagining that the federation code would ask for the state at the insertion event. I guess it probably works because we fetch the state at the start of the chain of state events? And we return the full state, so we then can accept all the state events we add? I don't think that is necessary to make the whole batch have the same state group.

Also, I wonder if that'll make the client UI show the state events when backpaginating, making it look like the state was changed at those points, when actually they were changed much further back?

Copy link
Contributor Author

@MadLittleMods MadLittleMods Dec 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that is necessary to make the whole batch have the same state group.

I can play around with it but that seems like something for another PR. It's pretty finicky to get right.

Also, I wonder if that'll make the client UI show the state events when backpaginating, making it look like the state was changed at those points, when actually they were changed much further back?

Doesn't seem to be a problem for the local origin homeserver with Element probably because they are marked as outliers 🤔

I want to test this on a federated homeserver though.

I'm trying to setup a federated homeserver locally to see if it's a problem for remote federated servers. Currently working out the hostname/server_name problem mapping to a port on localhost (tips welcome) and basing the config off of the demo script. I'm attempting to use /etc/hosts and a nginx reverse proxy to 127.0.0.1:8448 (non-tls) . Synapse is configured to be tls: false on 8008 and 8448. This appears to work to get my.matrix.host and other.matrix.host resolving but doesn't make Synapse happy enough to be able to successfully fetch the room list between each other.

Might just end up creating a Complement test around making sure the state isn't visible between batches ⏩ but would be nice to double-check with real Element about how it looks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to setup a federated homeserver locally to see if it's a problem for remote federated servers.

FYI you can start some preconfigured HSes that federate with each other by running ./demo/start.sh (and ./demo/stop.sh)

Copy link
Contributor Author

@MadLittleMods MadLittleMods Dec 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I wonder if that'll make the client UI show the state events when backpaginating, making it look like the state was changed at those points, when actually they were changed much further back?

Might just end up creating a Complement test around making sure the state isn't visible between batches ⏩ but would be nice to double-check with real Element about how it looks.

I updated the Complement test which tests multiple batches over federation to check for historical state and didn't see any problems between batches. But when the historical state chain is connected to the insertion event, it does show up before the creation event. Not sure how Element handles events before the creation event 🤷‍♀️

(image is in scrollback order, oldest messages at the top)

/messages response
{"chunk":[{"content":{"org.matrix.msc2716.marker.insertion":"$WaBcgnXayK2kF09ZpmfCftYGIxrtVkFoNvHh6aeU424"},"origin_server_ts":1638421073731,"room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@the-bridge-user:hs1","type":"org.matrix.msc2716.marker","unsigned":{"age":7480},"event_id":"$lS2ED7HslhXZkRx8VL1TXKDY3f_BKwFHUiQWs00dYa0","user_id":"@the-bridge-user:hs1","age":7480},{"type":"m.room.member","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@charlie:hs2","content":{"membership":"join","displayname":"charlie","avatar_url":null},"state_key":"@charlie:hs2","origin_server_ts":1638421073600,"unsigned":{"age":7604},"event_id":"$O-pdVPKIVSMkeM3HYVrZlGOOlT_vOB-a89neIAtc6xM","user_id":"@charlie:hs2","age":7604},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@alice:hs1","content":{"body":"Message 1 (eventIDsAfter)","msgtype":"m.text"},"origin_server_ts":1638421072318,"unsigned":{"age":1578},"event_id":"$g1ARnN19QFCcjwn1uhB_i8QOyWI-DO0re-UkcD-vx-w","user_id":"@alice:hs1","age":1578},{"type":"org.matrix.msc2716.insertion","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@the-bridge-user:hs1","content":{"org.matrix.msc2716.next_batch_id":"bWoojCNr","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072237,"unsigned":{"age":1464},"event_id":"$WaBcgnXayK2kF09ZpmfCftYGIxrtVkFoNvHh6aeU424","user_id":"@the-bridge-user:hs1","age":1464},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@alice:hs1","content":{"body":"Message 0 (eventIDsAfter)","msgtype":"m.text"},"origin_server_ts":1638421072266,"unsigned":{"age":1630},"event_id":"$FIvwe-eNldbj7tBHuF2T7WDxQm9V359KWOf-cRtKWSo","user_id":"@alice:hs1","age":1630},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 9 (batch=0)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072237,"unsigned":{"age":1612},"event_id":"$umIFPlRr2XmB3fick6hV7Y3QhkpxcYjnjukqmSLE5aQ","user_id":"@maria:hs1","age":1612},{"type":"org.matrix.msc2716.batch","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@the-bridge-user:hs1","content":{"org.matrix.msc2716.batch_id":"bWoojCNr","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072237,"unsigned":{"age":1433},"event_id":"$0bFJFfzv7E6COheiVMKxA1YfzX3ashIRPZXSZHROj7w","user_id":"@the-bridge-user:hs1","age":1433},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 8 (batch=0)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072236,"unsigned":{"age":1640},"event_id":"$z3OxR4a5TDfrSKEOie2NNaXmKmf6JPNsDPrPeT7_wYQ","user_id":"@maria:hs1","age":1640},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 7 (batch=0)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072235,"unsigned":{"age":1670},"event_id":"$vTZCRWjTrhK4patXggIjatGjSPZCFwOaYdSprU0q6wM","user_id":"@maria:hs1","age":1670},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 6 (batch=0)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072234,"unsigned":{"age":2205},"event_id":"$leVj2y-j_050_u6JADUiLwpEUdgnU5KUNDwxgcqb8L4","user_id":"@maria:hs1","age":2205},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 5 (batch=0)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072233,"unsigned":{"age":2745},"event_id":"$rQCHqPz54-EzCBPjM8euve-9bx3UOnYQvzctG1FrCe8","user_id":"@maria:hs1","age":2745},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 4 (batch=0)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072232,"unsigned":{"age":2780},"event_id":"$zmvZmUOtdMf32G4zW-VkfRCeN7y7vQY0jKcAmK3Dpeo","user_id":"@maria:hs1","age":2780},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 3 (batch=0)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072231,"unsigned":{"age":2813},"event_id":"$bZje4pt6EBeUQWO7itQsvjLpS-BzqXyaemqlUvxejW8","user_id":"@maria:hs1","age":2813},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 2 (batch=0)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072230,"unsigned":{"age":2846},"event_id":"$870hp6qsrfMrouJtEfpUAQwmRJCqaVbz4-P0OFeCMgo","user_id":"@maria:hs1","age":2846},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 1 (batch=0)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072229,"unsigned":{"age":3378},"event_id":"$Hj66b_hjH4day9qZX9RB3QNV9sTEg-0r2u4jhQECFQM","user_id":"@maria:hs1","age":3378},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 0 (batch=0)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072228,"unsigned":{"age":3921},"event_id":"$YMU4z7whUw8clargTpTYJ_rE8TbdIsGZpSyReHKrhm8","user_id":"@maria:hs1","age":3921},{"type":"org.matrix.msc2716.insertion","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@the-bridge-user:hs1","content":{"org.matrix.msc2716.next_batch_id":"DLkCgJwG","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072228,"unsigned":{"age":3965},"event_id":"$waIk9kxoQ6m8BQOrBAt0XMfmmVfD4WDXe5A4NJnPAM0","user_id":"@the-bridge-user:hs1","age":3965},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 9 (batch=1)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072227,"unsigned":{"age":3767},"event_id":"$wHINyaKdsd5xjxqO-BMDThuEBk2aOt2sJZGZzhwipCs","user_id":"@maria:hs1","age":3767},{"type":"org.matrix.msc2716.batch","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@the-bridge-user:hs1","content":{"org.matrix.msc2716.batch_id":"DLkCgJwG","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072227,"unsigned":{"age":1253},"event_id":"$sztVY6kBjSev1X3Hm6BViRNYyc1cQS5Vhjyt9lAMyMU","user_id":"@the-bridge-user:hs1","age":1253},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 8 (batch=1)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072226,"unsigned":{"age":3803},"event_id":"$GqXxKglEtttl-iIcpjDqShn5OTkW07SipgCzCq2iAjY","user_id":"@maria:hs1","age":3803},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 7 (batch=1)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072225,"unsigned":{"age":3838},"event_id":"$ZFDgIDCUMfs-qHDlSQW8F-LWiKIFRiHgTCqaXlPLe4k","user_id":"@maria:hs1","age":3838},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 6 (batch=1)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072224,"unsigned":{"age":4376},"event_id":"$oEVuLh6ZcbQGD3aeFkr2tYUwtCCkyO5qGAFGz2fLTnw","user_id":"@maria:hs1","age":4376},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 5 (batch=1)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072223,"unsigned":{"age":4917},"event_id":"$5x2BQurlJ3T4GcspRlF8fOW9CrwKwkauAgkgBXOjVSc","user_id":"@maria:hs1","age":4917},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 4 (batch=1)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072222,"unsigned":{"age":4956},"event_id":"$r4e4rp9HuJ2gW_-1U4favhRTiqIsYeQXlG4L9b8RvEA","user_id":"@maria:hs1","age":4956},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 3 (batch=1)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072221,"unsigned":{"age":4990},"event_id":"$I-Vc7nCmA2UI9zCW0jsjA9QU-xo8XrRa9crUCikQ484","user_id":"@maria:hs1","age":4990},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 2 (batch=1)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072220,"unsigned":{"age":5023},"event_id":"$kew5mWiogSEWq5WJiIwqoylrmC4Mbi63EXT63H-lmIY","user_id":"@maria:hs1","age":5023},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 1 (batch=1)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072219,"unsigned":{"age":5554},"event_id":"$SKCLLf0Aok4urhbf-0wY_r_ACEAjaPi9pjec62fYpVE","user_id":"@maria:hs1","age":5554},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 0 (batch=1)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072218,"unsigned":{"age":6099},"event_id":"$14kxr9vQItjx2JawLphSmrj1Jwr8kfc_EOx-gT-iong","user_id":"@maria:hs1","age":6099},{"type":"org.matrix.msc2716.insertion","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@the-bridge-user:hs1","content":{"org.matrix.msc2716.next_batch_id":"CoyLEmTJ","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072218,"unsigned":{"age":6140},"event_id":"$gZx6dAB98BmyjAdCVZKgayF_c4L_gz1cy45i-8N4fSI","user_id":"@the-bridge-user:hs1","age":6140},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 9 (batch=2)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072217,"unsigned":{"age":5947},"event_id":"$pFssNAX_rVeY_PhxSSMquxHLZXr5oN05Fiv_QfPCvkE","user_id":"@maria:hs1","age":5947},{"type":"org.matrix.msc2716.batch","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@the-bridge-user:hs1","content":{"org.matrix.msc2716.batch_id":"CoyLEmTJ","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072217,"unsigned":{"age":1069},"event_id":"$JVTwaVHhgnW8cfjVqW-pS_5mhODVJZa4PVHxdG1Efzc","user_id":"@the-bridge-user:hs1","age":1069},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 8 (batch=2)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072216,"unsigned":{"age":5980},"event_id":"$qCMOwxe1GrVNzyWKN3zaQ-lg3lW1DUNrpfoRnebWFm4","user_id":"@maria:hs1","age":5980},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 7 (batch=2)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072215,"unsigned":{"age":6012},"event_id":"$UfDaJL_LPXVwXKKQs73XzYmI-Uir4jN7W6IziZ2SCYI","user_id":"@maria:hs1","age":6012},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 6 (batch=2)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072214,"unsigned":{"age":6552},"event_id":"$TeMnyuzXPRShgq3Fh1pQN96cssNHqtH4iGTvK8ZHAMw","user_id":"@maria:hs1","age":6552},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 5 (batch=2)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072213,"unsigned":{"age":7089},"event_id":"$Cn4JfL0SeaTBiRd_LNqZAVuvMmR8AvGUKYCOjg5uTt0","user_id":"@maria:hs1","age":7089},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 4 (batch=2)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072212,"unsigned":{"age":7126},"event_id":"$V9_aO69DgrYi2WMiPmgPcUuvD05dyncCldrKtUfzZSA","user_id":"@maria:hs1","age":7126},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 3 (batch=2)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072211,"unsigned":{"age":7164},"event_id":"$tJvxEsxTR9HJliBPcNSvJFmOY94ciipYTAXUov_K_Yo","user_id":"@maria:hs1","age":7164},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 2 (batch=2)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072210,"unsigned":{"age":7200},"event_id":"$Rdp3bV85LI-s3PvGmUOruK2TltWpULtpYcJ5WKQg6m8","user_id":"@maria:hs1","age":7200},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 1 (batch=2)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072209,"unsigned":{"age":7741},"event_id":"$gs5cV3RM2-TuKjGz0BGPsxlrMdUNVD0cjgdx1H7hQdE","user_id":"@maria:hs1","age":7741},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"body":"Historical 0 (batch=2)","msgtype":"m.text","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072208,"unsigned":{"age":8286},"event_id":"$kqSb-7ejvJqCbMw0n3HoNtlX1xLV_vqoj0p5pmyp6Os","user_id":"@maria:hs1","age":8286},{"type":"org.matrix.msc2716.insertion","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@the-bridge-user:hs1","content":{"org.matrix.msc2716.next_batch_id":"nhKNQtdq","org.matrix.msc2716.historical":true},"origin_server_ts":1638421072208,"unsigned":{"age":8335},"event_id":"$QWeEjdorD08UUrOSv4V51uruiFwN9AW2pyhMtjTKdWc","user_id":"@the-bridge-user:hs1","age":8335},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@alice:hs1","content":{"body":"Message 1 (eventIDsBefore)","msgtype":"m.text"},"origin_server_ts":1638421072192,"unsigned":{"age":1704},"event_id":"$o9SYeHYTCBmh7I8oQUuYrYiunNnRh6hm-hajCz_uVn8","user_id":"@alice:hs1","age":1704},{"type":"m.room.message","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@alice:hs1","content":{"body":"Message 0 (eventIDsBefore)","msgtype":"m.text"},"origin_server_ts":1638421072119,"unsigned":{"age":1777},"event_id":"$tvHWwYy5am7_ivgPNMRMevMdbEnYldR0cOJzV4IK9D0","user_id":"@alice:hs1","age":1777},{"type":"m.room.member","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@alice:hs1","content":{"membership":"join","displayname":"alice"},"state_key":"@alice:hs1","origin_server_ts":1638421072077,"unsigned":{"age":1565},"event_id":"$ejmNHLgOrZ_dDN0CsooWespSg0vZ8zVTl77M12ke_PY","user_id":"@alice:hs1","age":1565},{"type":"m.room.name","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@the-bridge-user:hs1","content":{"name":"the hangout spot"},"state_key":"","origin_server_ts":1638421072038,"unsigned":{"age":1604},"event_id":"$MM3mC6Ig2bVODUcI1EEphKLBO_q2t0jXCErMxpdFgaM","user_id":"@the-bridge-user:hs1","age":1604},{"type":"m.room.history_visibility","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@the-bridge-user:hs1","content":{"history_visibility":"shared"},"state_key":"","origin_server_ts":1638421072010,"unsigned":{"age":1632},"event_id":"$M6OepRC0jQYBjmv7sQNup4MiJIdMG8TbdDBO0cMkVZ8","user_id":"@the-bridge-user:hs1","age":1632},{"type":"m.room.join_rules","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@the-bridge-user:hs1","content":{"join_rule":"public"},"state_key":"","origin_server_ts":1638421071982,"unsigned":{"age":1660},"event_id":"$H0JEhKMu0cbWH6lnIu_UpKWWh9ooVq3Wu3Dgj9SPUF0","user_id":"@the-bridge-user:hs1","age":1660},{"type":"m.room.power_levels","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@the-bridge-user:hs1","content":{"users":{"@the-bridge-user:hs1":100},"users_default":0,"events":{"m.room.name":50,"m.room.power_levels":100,"m.room.history_visibility":100,"m.room.canonical_alias":50,"m.room.avatar":50,"m.room.tombstone":100,"m.room.server_acl":100,"m.room.encryption":100},"events_default":0,"state_default":50,"ban":50,"kick":50,"redact":50,"invite":50,"historical":100},"state_key":"","origin_server_ts":1638421071938,"unsigned":{"age":1704},"event_id":"$5vDhHe7-M7M_hET9i2-MhLESIDILl9r9HadKksWbtos","user_id":"@the-bridge-user:hs1","age":1704},{"type":"m.room.member","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@the-bridge-user:hs1","content":{"membership":"join"},"state_key":"@the-bridge-user:hs1","origin_server_ts":1638421071897,"unsigned":{"age":1745},"event_id":"$7IaD95Sp4SRExyY971nzbcXgI9S67pQ9FnfdMIEjheI","user_id":"@the-bridge-user:hs1","age":1745},{"type":"m.room.create","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@the-bridge-user:hs1","content":{"room_version":"org.matrix.msc2716v4","creator":"@the-bridge-user:hs1"},"state_key":"","origin_server_ts":1638421071834,"unsigned":{"age":1808},"event_id":"$yigMLKdi72kpZFdwTpJL-s71lV_vLqJAKgVeboqXA-g","user_id":"@the-bridge-user:hs1","age":1808},{"type":"m.room.member","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"displayname":"some-display-name-for-@maria:hs1","membership":"join","org.matrix.msc2716.historical":true},"state_key":"@maria:hs1","origin_server_ts":1638421072739,"unsigned":{"age":1158},"event_id":"$Ean2gLNBtIH6CHaSQ5XicbIZ1pYk-N7PFIO9RTytSM0","user_id":"@maria:hs1","age":1158},{"type":"m.room.member","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"displayname":"some-display-name-for-@maria:hs1","membership":"join","org.matrix.msc2716.historical":true},"state_key":"@maria:hs1","origin_server_ts":1638421072570,"unsigned":{"age":1327},"event_id":"$LJUfF9Eo58Nbq7cNYoN-oGowd_OwfzgUkux4O3Ksikk","user_id":"@maria:hs1","age":1327},{"type":"m.room.member","room_id":"!FRNexMHUjKhRxPvPzq:hs1","sender":"@maria:hs1","content":{"displayname":"some-display-name-for-@maria:hs1","membership":"join","org.matrix.msc2716.historical":true},"state_key":"@maria:hs1","origin_server_ts":1638421072370,"unsigned":{"age":1527},"event_id":"$OIbefO5BM9jGxwk7_lF3Wdy9gO-PG1ZuGq2rQscznOg","user_id":"@maria:hs1","age":1527}],"start":"s3_0_0_0_0_0_0_0_0","end":"t1--13_0_0_0_0_0_0_0_0"}

Copy link
Contributor Author

@MadLittleMods MadLittleMods Dec 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that is necessary to make the whole batch have the same state group.

I created #11487 to add a test to ensure the state_groups are shared.

Things seem to work just fine if I disconnect the floating state chain from the insertion event so we can move forward with that in #11114 (comment) after this merges.

Both the state chain and the insertion event chain can float with no prev_events. No issues with shared state_groups, accepting over federation, and the historical state does not show up at all in /messages

@MadLittleMods MadLittleMods requested review from erikjohnston and removed request for erikjohnston December 2, 2021 08:10
Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me, sorry for long RTT ❤️

synapse/handlers/message.py Outdated Show resolved Hide resolved
changelog.d/11243.feature Outdated Show resolved Hide resolved
@MadLittleMods MadLittleMods merged commit aa8708e into develop Dec 11, 2021
@MadLittleMods MadLittleMods deleted the madlittlemods/empty-prev-events branch December 11, 2021 05:08
@MadLittleMods
Copy link
Contributor Author

Thanks for the review @erikjohnston @anoadragon453 @richvdh 🦎

Happy to see this one get across the line! 🥌

Fizzadar pushed a commit to Fizzadar/synapse that referenced this pull request Jan 19, 2022
Synapse 1.50.0 (2022-01-18)
===========================

Please note that we now only support Python 3.7+ and PostgreSQL 10+ (if applicable), because Python 3.6 and PostgreSQL 9.6 have reached end-of-life.

No significant changes since 1.50.0rc2.

Synapse 1.50.0rc2 (2022-01-14)
==============================

This release candidate fixes a federation-breaking regression introduced in Synapse 1.50.0rc1.

Bugfixes
--------

- Fix a bug introduced in Synapse v1.0.0 whereby some device list updates would not be sent to remote homeservers if there were too many to send at once. ([\matrix-org#11729](matrix-org#11729))
- Fix a bug introduced in Synapse v1.50.0rc1 whereby outbound federation could fail because too many EDUs were produced for device updates. ([\matrix-org#11730](matrix-org#11730))

Improved Documentation
----------------------

- Document that now the minimum supported PostgreSQL version is 10. ([\matrix-org#11725](matrix-org#11725))

Internal Changes
----------------

- Fix a typechecker problem related to our (ab)use of `nacl.signing.SigningKey`s. ([\matrix-org#11714](matrix-org#11714))

Synapse 1.50.0rc1 (2022-01-05)
==============================

Features
--------

- Allow guests to send state events per [MSC3419](matrix-org/matrix-spec-proposals#3419). ([\matrix-org#11378](matrix-org#11378))
- Add experimental support for part of [MSC3202](matrix-org/matrix-spec-proposals#3202): allowing application services to masquerade as specific devices. ([\matrix-org#11538](matrix-org#11538))
- Add admin API to get users' account data. ([\matrix-org#11664](matrix-org#11664))
- Include the room topic in the stripped state included with invites and knocking. ([\matrix-org#11666](matrix-org#11666))
- Send and handle cross-signing messages using the stable prefix. ([\matrix-org#10520](matrix-org#10520))
- Support unprefixed versions of fallback key property names. ([\matrix-org#11541](matrix-org#11541))

Bugfixes
--------

- Fix a long-standing bug where relations from other rooms could be included in the bundled aggregations of an event. ([\matrix-org#11516](matrix-org#11516))
- Fix a long-standing bug which could cause `AssertionError`s to be written to the log when Synapse was restarted after purging events from the database. ([\matrix-org#11536](matrix-org#11536), [\matrix-org#11642](matrix-org#11642))
- Fix a bug introduced in Synapse 1.17.0 where a pusher created for an email with capital letters would fail to be created. ([\matrix-org#11547](matrix-org#11547))
- Fix a long-standing bug where responses included bundled aggregations when they should not, per [MSC2675](matrix-org/matrix-spec-proposals#2675). ([\matrix-org#11592](matrix-org#11592), [\matrix-org#11623](matrix-org#11623))
- Fix a long-standing bug that some unknown endpoints would return HTML error pages instead of JSON `M_UNRECOGNIZED` errors. ([\matrix-org#11602](matrix-org#11602))
- Fix a bug introduced in Synapse 1.19.3 which could sometimes cause `AssertionError`s when backfilling rooms over federation. ([\matrix-org#11632](matrix-org#11632))

Improved Documentation
----------------------

- Update Synapse install command for FreeBSD as the package is now prefixed with `py38`. Contributed by @itchychips. ([\matrix-org#11267](matrix-org#11267))
- Document the usage of refresh tokens. ([\matrix-org#11427](matrix-org#11427))
- Add details for how to configure a TURN server when behind a NAT. Contibuted by @AndrewFerr. ([\matrix-org#11553](matrix-org#11553))
- Add references for using Postgres to the Docker documentation. ([\matrix-org#11640](matrix-org#11640))
- Fix the documentation link in newly-generated configuration files. ([\matrix-org#11678](matrix-org#11678))
- Correct the documentation for `nginx` to use a case-sensitive url pattern. Fixes an error introduced in v1.21.0. ([\matrix-org#11680](matrix-org#11680))
- Clarify SSO mapping provider documentation by writing `def` or `async def` before the names of methods, as appropriate. ([\matrix-org#11681](matrix-org#11681))

Deprecations and Removals
-------------------------

- Replace `mock` package by its standard library version. ([\matrix-org#11588](matrix-org#11588))
- Drop support for Python 3.6 and Ubuntu 18.04. ([\matrix-org#11633](matrix-org#11633))

Internal Changes
----------------

- Allow specific, experimental events to be created without `prev_events`. Used by [MSC2716](matrix-org/matrix-spec-proposals#2716). ([\matrix-org#11243](matrix-org#11243))
- A test helper (`wait_for_background_updates`) no longer depends on classes defining a `store` property. ([\matrix-org#11331](matrix-org#11331))
- Add type hints to `synapse.appservice`. ([\matrix-org#11360](matrix-org#11360))
- Add missing type hints to `synapse.config` module. ([\matrix-org#11480](matrix-org#11480))
- Add test to ensure we share the same `state_group` across the whole historical batch when using the [MSC2716](matrix-org/matrix-spec-proposals#2716) `/batch_send` endpoint. ([\matrix-org#11487](matrix-org#11487))
- Refactor `tests.util.setup_test_homeserver` and `tests.server.setup_test_homeserver`. ([\matrix-org#11503](matrix-org#11503))
- Move `glob_to_regex` and `re_word_boundary` to `matrix-python-common`. ([\matrix-org#11505](matrix-org#11505), [\matrix-org#11687](matrix-org#11687))
- Use `HTTPStatus` constants in place of literals in `tests.rest.client.test_auth`. ([\matrix-org#11520](matrix-org#11520))
- Add a receipt types constant for `m.read`. ([\matrix-org#11531](matrix-org#11531))
- Clean up `synapse.rest.admin`. ([\matrix-org#11535](matrix-org#11535))
- Add missing `errcode` to `parse_string` and `parse_boolean`. ([\matrix-org#11542](matrix-org#11542))
- Use `HTTPStatus` constants in place of literals in `synapse.http`. ([\matrix-org#11543](matrix-org#11543))
- Add missing type hints to storage classes. ([\matrix-org#11546](matrix-org#11546), [\matrix-org#11549](matrix-org#11549), [\matrix-org#11551](matrix-org#11551), [\matrix-org#11555](matrix-org#11555), [\matrix-org#11575](matrix-org#11575), [\matrix-org#11589](matrix-org#11589), [\matrix-org#11594](matrix-org#11594), [\matrix-org#11652](matrix-org#11652), [\matrix-org#11653](matrix-org#11653), [\matrix-org#11654](matrix-org#11654), [\matrix-org#11657](matrix-org#11657))
- Fix an inaccurate and misleading comment in the `/sync` code. ([\matrix-org#11550](matrix-org#11550))
- Add missing type hints to `synapse.logging.context`. ([\matrix-org#11556](matrix-org#11556))
- Stop populating unused database column `state_events.prev_state`. ([\matrix-org#11558](matrix-org#11558))
- Minor efficiency improvements in event persistence. ([\matrix-org#11560](matrix-org#11560))
- Add some safety checks that storage functions are used correctly. ([\matrix-org#11564](matrix-org#11564), [\matrix-org#11580](matrix-org#11580))
- Make `get_device` return `None` if the device doesn't exist rather than raising an exception. ([\matrix-org#11565](matrix-org#11565))
- Split the HTML parsing code from the URL preview resource code. ([\matrix-org#11566](matrix-org#11566))
- Remove redundant `COALESCE()`s around `COUNT()`s in database queries. ([\matrix-org#11570](matrix-org#11570))
- Add missing type hints to `synapse.http`. ([\matrix-org#11571](matrix-org#11571))
- Add [MSC2716](matrix-org/matrix-spec-proposals#2716) and [MSC3030](matrix-org/matrix-spec-proposals#3030) to `/versions` -> `unstable_features` to detect server support. ([\matrix-org#11582](matrix-org#11582))
- Add type hints to `synapse/tests/rest/admin`. ([\matrix-org#11590](matrix-org#11590))
- Drop end-of-life Python 3.6 and Postgres 9.6 from CI. ([\matrix-org#11595](matrix-org#11595))
- Update black version and run it on all the files. ([\matrix-org#11596](matrix-org#11596))
- Add opentracing type stubs and fix associated mypy errors. ([\matrix-org#11603](matrix-org#11603), [\matrix-org#11622](matrix-org#11622))
- Improve OpenTracing support for requests which use a `ResponseCache`. ([\matrix-org#11607](matrix-org#11607))
- Improve OpenTracing support for incoming HTTP requests. ([\matrix-org#11618](matrix-org#11618))
- A number of improvements to opentracing support. ([\matrix-org#11619](matrix-org#11619))
- Refactor the way that the `outlier` flag is set on events received over federation. ([\matrix-org#11634](matrix-org#11634))
- Improve the error messages from  `get_create_event_for_room`. ([\matrix-org#11638](matrix-org#11638))
- Remove redundant `get_current_events_token` method. ([\matrix-org#11643](matrix-org#11643))
- Convert `namedtuples` to `attrs`. ([\matrix-org#11665](matrix-org#11665), [\matrix-org#11574](matrix-org#11574))
- Update the `/capabilities` response to include whether support for [MSC3440](matrix-org/matrix-spec-proposals#3440) is available. ([\matrix-org#11690](matrix-org#11690))
- Send the `Accept` header in HTTP requests made using `SimpleHttpClient.get_json`. ([\matrix-org#11677](matrix-org#11677))
- Work around Mjolnir compatibility issue by adding an import for `glob_to_regex` in `synapse.util`, where it moved from. ([\matrix-org#11696](matrix-org#11696))
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jan 30, 2022
Synapse 1.51.0 (2022-01-25)
===========================

No significant changes since 1.51.0rc2.

Synapse 1.51.0 deprecates `webclient` listeners and non-HTTP(S) `web_client_location`s. Support for these will be removed in Synapse 1.53.0, at which point Synapse will not be capable of directly serving a web client for Matrix.

Synapse 1.51.0rc2 (2022-01-24)
==============================

Bugfixes
--------

- Fix a bug introduced in Synapse 1.40.0 that caused Synapse to fail to process incoming federation traffic after handling a large amount of events in a v1 room. ([\#11806](matrix-org/synapse#11806))


Synapse 1.51.0rc1 (2022-01-21)
==============================

Features
--------

- Add `track_puppeted_user_ips` config flag to record client IP addresses against puppeted users, and include the puppeted users in monthly active user counts. ([\#11561](matrix-org/synapse#11561), [\#11749](matrix-org/synapse#11749), [\#11757](matrix-org/synapse#11757))
- Include whether the requesting user has participated in a thread when generating a summary for [MSC3440](matrix-org/matrix-spec-proposals#3440). ([\#11577](matrix-org/synapse#11577))
- Return an `M_FORBIDDEN` error code instead of `M_UNKNOWN` when a spam checker module prevents a user from creating a room. ([\#11672](matrix-org/synapse#11672))
- Add a flag to the `synapse_review_recent_signups` script to ignore and filter appservice users. ([\#11675](matrix-org/synapse#11675), [\#11770](matrix-org/synapse#11770))


Bugfixes
--------

- Fix a long-standing issue which could cause Synapse to incorrectly accept data in the unsigned field of events
  received over federation. ([\#11530](matrix-org/synapse#11530))
- Fix a long-standing bug where Synapse wouldn't cache a response indicating that a remote user has no devices. ([\#11587](matrix-org/synapse#11587))
- Fix an error that occurs whilst trying to get the federation status of a destination server that was working normally. This admin API was newly introduced in Synapse v1.49.0. ([\#11593](matrix-org/synapse#11593))
- Fix bundled aggregations not being included in the `/sync` response, per [MSC2675](matrix-org/matrix-spec-proposals#2675). ([\#11612](matrix-org/synapse#11612), [\#11659](matrix-org/synapse#11659), [\#11791](matrix-org/synapse#11791))
- Fix the `/_matrix/client/v1/room/{roomId}/hierarchy` endpoint returning incorrect fields which have been present since Synapse 1.49.0. ([\#11667](matrix-org/synapse#11667))
- Fix preview of some GIF URLs (like tenor.com). Contributed by Philippe Daouadi. ([\#11669](matrix-org/synapse#11669))
- Fix a bug where only the first 50 rooms from a space were returned from the `/hierarchy` API. This has existed since the introduction of the API in Synapse v1.41.0. ([\#11695](matrix-org/synapse#11695))
- Fix a bug introduced in Synapse v1.18.0 where password reset and address validation emails would not be sent if their subject was configured to use the 'app' template variable. Contributed by @br4nnigan. ([\#11710](matrix-org/synapse#11710), [\#11745](matrix-org/synapse#11745))
- Make the 'List Rooms' Admin API sort stable. Contributed by Daniël Sonck. ([\#11737](matrix-org/synapse#11737))
- Fix a long-standing bug where space hierarchy over federation would only work correctly some of the time. ([\#11775](matrix-org/synapse#11775))
- Fix a bug introduced in Synapse v1.46.0 that prevented `on_logged_out` module callbacks from being correctly awaited by Synapse. ([\#11786](matrix-org/synapse#11786))


Improved Documentation
----------------------

- Warn against using a Let's Encrypt certificate for TLS/DTLS TURN server client connections, and suggest using ZeroSSL certificate instead. This works around client-side connectivity errors caused by WebRTC libraries that reject Let's Encrypt certificates. Contibuted by @AndrewFerr. ([\#11686](matrix-org/synapse#11686))
- Document the new `SYNAPSE_TEST_PERSIST_SQLITE_DB` environment variable in the contributing guide. ([\#11715](matrix-org/synapse#11715))
- Document that the minimum supported PostgreSQL version is now 10. ([\#11725](matrix-org/synapse#11725))
- Fix typo in demo docs: differnt. ([\#11735](matrix-org/synapse#11735))
- Update room spec URL in config files. ([\#11739](matrix-org/synapse#11739))
- Mention `python3-venv` and `libpq-dev` dependencies in the contribution guide. ([\#11740](matrix-org/synapse#11740))
- Update documentation for configuring login with Facebook. ([\#11755](matrix-org/synapse#11755))
- Update installation instructions to note that Python 3.6 is no longer supported. ([\#11781](matrix-org/synapse#11781))


Deprecations and Removals
-------------------------

- Remove the unstable `/send_relation` endpoint. ([\#11682](matrix-org/synapse#11682))
- Remove `python_twisted_reactor_pending_calls` Prometheus metric. ([\#11724](matrix-org/synapse#11724))
- Remove the `password_hash` field from the response dictionaries of the [Users Admin API](https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html). ([\#11576](matrix-org/synapse#11576))
- **Deprecate support for `webclient` listeners and non-HTTP(S) `web_client_location` configuration. ([\#11774](matrix-org/synapse#11774), [\#11783](matrix-org/synapse#11783


Internal Changes
----------------

- Run `pyupgrade --py37-plus --keep-percent-format` on Synapse. ([\#11685](matrix-org/synapse#11685))
- Use buildkit's cache feature to speed up docker builds. ([\#11691](matrix-org/synapse#11691))
- Use `auto_attribs` and native type hints for attrs classes. ([\#11692](matrix-org/synapse#11692), [\#11768](matrix-org/synapse#11768))
- Remove debug logging for #4422, which has been closed since Synapse 0.99. ([\#11693](matrix-org/synapse#11693))
- Remove fallback code for Python 2. ([\#11699](matrix-org/synapse#11699))
- Add a test for [an edge case](matrix-org/synapse#11532 (comment)) in the `/sync` logic. ([\#11701](matrix-org/synapse#11701))
- Add the option to write SQLite test dbs to disk when running tests. ([\#11702](matrix-org/synapse#11702))
- Improve Complement test output for Gitub Actions. ([\#11707](matrix-org/synapse#11707))
- Fix docstring on `add_account_data_for_user`. ([\#11716](matrix-org/synapse#11716))
- Complement environment variable name change and update `.gitignore`. ([\#11718](matrix-org/synapse#11718))
- Simplify calculation of Prometheus metrics for garbage collection. ([\#11723](matrix-org/synapse#11723))
- Improve accuracy of `python_twisted_reactor_tick_time` Prometheus metric. ([\#11724](matrix-org/synapse#11724), [\#11771](matrix-org/synapse#11771))
- Minor efficiency improvements when inserting many values into the database. ([\#11742](matrix-org/synapse#11742))
- Invite PR authors to give themselves credit in the changelog. ([\#11744](matrix-org/synapse#11744))
- Add optional debugging to investigate [issue 8631](matrix-org/synapse#8631). ([\#11760](matrix-org/synapse#11760))
- Remove `log_function` utility function and its uses. ([\#11761](matrix-org/synapse#11761))
- Add a unit test that checks both `client` and `webclient` resources will function when simultaneously enabled. ([\#11765](matrix-org/synapse#11765))
- Allow overriding complement commit using `COMPLEMENT_REF`. ([\#11766](matrix-org/synapse#11766))
- Add some comments and type annotations for `_update_outliers_txn`. ([\#11776](matrix-org/synapse#11776))


Synapse 1.50.1 (2022-01-18)
===========================

This release fixes a bug in Synapse 1.50.0 that could prevent clients from being able to connect to Synapse if the `webclient` resource was enabled. Further details are available in [this issue](matrix-org/synapse#11763).

Bugfixes
--------

- Fix a bug introduced in Synapse 1.50.0rc1 that could cause Matrix clients to be unable to connect to Synapse instances with the `webclient` resource enabled. ([\#11764](matrix-org/synapse#11764))


Synapse 1.50.0 (2022-01-18)
===========================

**This release contains a critical bug that may prevent clients from being able to connect.
As such, it is not recommended to upgrade to 1.50.0. Instead, please upgrade straight to
to 1.50.1. Further details are available in [this issue](matrix-org/synapse#11763

Please note that we now only support Python 3.7+ and PostgreSQL 10+ (if applicable), because Python 3.6 and PostgreSQL 9.6 have reached end-of-life.

No significant changes since 1.50.0rc2.


Synapse 1.50.0rc2 (2022-01-14)
==============================

This release candidate fixes a federation-breaking regression introduced in Synapse 1.50.0rc1.

Bugfixes
--------

- Fix a bug introduced in Synapse v1.0.0 whereby some device list updates would not be sent to remote homeservers if there were too many to send at once. ([\#11729](matrix-org/synapse#11729))
- Fix a bug introduced in Synapse v1.50.0rc1 whereby outbound federation could fail because too many EDUs were produced for device updates. ([\#11730](matrix-org/synapse#11730))


Improved Documentation
----------------------

- Document that now the minimum supported PostgreSQL version is 10. ([\#11725](matrix-org/synapse#11725))


Internal Changes
----------------

- Fix a typechecker problem related to our (ab)use of `nacl.signing.SigningKey`s. ([\#11714](matrix-org/synapse#11714))


Synapse 1.50.0rc1 (2022-01-05)
==============================


Features
--------

- Allow guests to send state events per [MSC3419](matrix-org/matrix-spec-proposals#3419). ([\#11378](matrix-org/synapse#11378))
- Add experimental support for part of [MSC3202](matrix-org/matrix-spec-proposals#3202): allowing application services to masquerade as specific devices. ([\#11538](matrix-org/synapse#11538))
- Add admin API to get users' account data. ([\#11664](matrix-org/synapse#11664))
- Include the room topic in the stripped state included with invites and knocking. ([\#11666](matrix-org/synapse#11666))
- Send and handle cross-signing messages using the stable prefix. ([\#10520](matrix-org/synapse#10520))
- Support unprefixed versions of fallback key property names. ([\#11541](matrix-org/synapse#11541))


Bugfixes
--------

- Fix a long-standing bug where relations from other rooms could be included in the bundled aggregations of an event. ([\#11516](matrix-org/synapse#11516))
- Fix a long-standing bug which could cause `AssertionError`s to be written to the log when Synapse was restarted after purging events from the database. ([\#11536](matrix-org/synapse#11536), [\#11642](matrix-org/synapse#11642))
- Fix a bug introduced in Synapse 1.17.0 where a pusher created for an email with capital letters would fail to be created. ([\#11547](matrix-org/synapse#11547))
- Fix a long-standing bug where responses included bundled aggregations when they should not, per [MSC2675](matrix-org/matrix-spec-proposals#2675). ([\#11592](matrix-org/synapse#11592), [\#11623](matrix-org/synapse#11623))
- Fix a long-standing bug that some unknown endpoints would return HTML error pages instead of JSON `M_UNRECOGNIZED` errors. ([\#11602](matrix-org/synapse#11602))
- Fix a bug introduced in Synapse 1.19.3 which could sometimes cause `AssertionError`s when backfilling rooms over federation. ([\#11632](matrix-org/synapse#11632))


Improved Documentation
----------------------

- Update Synapse install command for FreeBSD as the package is now prefixed with `py38`. Contributed by @itchychips. ([\#11267](matrix-org/synapse#11267))
- Document the usage of refresh tokens. ([\#11427](matrix-org/synapse#11427))
- Add details for how to configure a TURN server when behind a NAT. Contibuted by @AndrewFerr. ([\#11553](matrix-org/synapse#11553))
- Add references for using Postgres to the Docker documentation. ([\#11640](matrix-org/synapse#11640))
- Fix the documentation link in newly-generated configuration files. ([\#11678](matrix-org/synapse#11678))
- Correct the documentation for `nginx` to use a case-sensitive url pattern. Fixes an error introduced in v1.21.0. ([\#11680](matrix-org/synapse#11680))
- Clarify SSO mapping provider documentation by writing `def` or `async def` before the names of methods, as appropriate. ([\#11681](matrix-org/synapse#11681))


Deprecations and Removals
-------------------------

- Replace `mock` package by its standard library version. ([\#11588](matrix-org/synapse#11588))
- Drop support for Python 3.6 and Ubuntu 18.04. ([\#11633](matrix-org/synapse#11633))


Internal Changes
----------------

- Allow specific, experimental events to be created without `prev_events`. Used by [MSC2716](matrix-org/matrix-spec-proposals#2716). ([\#11243](matrix-org/synapse#11243))
- A test helper (`wait_for_background_updates`) no longer depends on classes defining a `store` property. ([\#11331](matrix-org/synapse#11331))
- Add type hints to `synapse.appservice`. ([\#11360](matrix-org/synapse#11360))
- Add missing type hints to `synapse.config` module. ([\#11480](matrix-org/synapse#11480))
- Add test to ensure we share the same `state_group` across the whole historical batch when using the [MSC2716](matrix-org/matrix-spec-proposals#2716) `/batch_send` endpoint. ([\#11487](matrix-org/synapse#11487))
- Refactor `tests.util.setup_test_homeserver` and `tests.server.setup_test_homeserver`. ([\#11503](matrix-org/synapse#11503))
- Move `glob_to_regex` and `re_word_boundary` to `matrix-python-common`. ([\#11505](matrix-org/synapse#11505), [\#11687](matrix-org/synapse#11687))
- Use `HTTPStatus` constants in place of literals in `tests.rest.client.test_auth`. ([\#11520](matrix-org/synapse#11520))
- Add a receipt types constant for `m.read`. ([\#11531](matrix-org/synapse#11531))
- Clean up `synapse.rest.admin`. ([\#11535](matrix-org/synapse#11535))
- Add missing `errcode` to `parse_string` and `parse_boolean`. ([\#11542](matrix-org/synapse#11542))
- Use `HTTPStatus` constants in place of literals in `synapse.http`. ([\#11543](matrix-org/synapse#11543))
- Add missing type hints to storage classes. ([\#11546](matrix-org/synapse#11546), [\#11549](matrix-org/synapse#11549), [\#11551](matrix-org/synapse#11551), [\#11555](matrix-org/synapse#11555), [\#11575](matrix-org/synapse#11575), [\#11589](matrix-org/synapse#11589), [\#11594](matrix-org/synapse#11594), [\#11652](matrix-org/synapse#11652), [\#11653](matrix-org/synapse#11653), [\#11654](matrix-org/synapse#11654), [\#11657](matrix-org/synapse#11657))
- Fix an inaccurate and misleading comment in the `/sync` code. ([\#11550](matrix-org/synapse#11550))
- Add missing type hints to `synapse.logging.context`. ([\#11556](matrix-org/synapse#11556))
- Stop populating unused database column `state_events.prev_state`. ([\#11558](matrix-org/synapse#11558))
- Minor efficiency improvements in event persistence. ([\#11560](matrix-org/synapse#11560))
- Add some safety checks that storage functions are used correctly. ([\#11564](matrix-org/synapse#11564), [\#11580](matrix-org/synapse#11580))
- Make `get_device` return `None` if the device doesn't exist rather than raising an exception. ([\#11565](matrix-org/synapse#11565))
- Split the HTML parsing code from the URL preview resource code. ([\#11566](matrix-org/synapse#11566))
- Remove redundant `COALESCE()`s around `COUNT()`s in database queries. ([\#11570](matrix-org/synapse#11570))
- Add missing type hints to `synapse.http`. ([\#11571](matrix-org/synapse#11571))
- Add [MSC2716](matrix-org/matrix-spec-proposals#2716) and [MSC3030](matrix-org/matrix-spec-proposals#3030) to `/versions` -> `unstable_features` to detect server support. ([\#11582](matrix-org/synapse#11582))
- Add type hints to `synapse/tests/rest/admin`. ([\#11590](matrix-org/synapse#11590))
- Drop end-of-life Python 3.6 and Postgres 9.6 from CI. ([\#11595](matrix-org/synapse#11595))
- Update black version and run it on all the files. ([\#11596](matrix-org/synapse#11596))
- Add opentracing type stubs and fix associated mypy errors. ([\#11603](matrix-org/synapse#11603), [\#11622](matrix-org/synapse#11622))
- Improve OpenTracing support for requests which use a `ResponseCache`. ([\#11607](matrix-org/synapse#11607))
- Improve OpenTracing support for incoming HTTP requests. ([\#11618](matrix-org/synapse#11618))
- A number of improvements to opentracing support. ([\#11619](matrix-org/synapse#11619))
- Refactor the way that the `outlier` flag is set on events received over federation. ([\#11634](matrix-org/synapse#11634))
- Improve the error messages from  `get_create_event_for_room`. ([\#11638](matrix-org/synapse#11638))
- Remove redundant `get_current_events_token` method. ([\#11643](matrix-org/synapse#11643))
- Convert `namedtuples` to `attrs`. ([\#11665](matrix-org/synapse#11665), [\#11574](matrix-org/synapse#11574))
- Update the `/capabilities` response to include whether support for [MSC3440](matrix-org/matrix-spec-proposals#3440) is available. ([\#11690](matrix-org/synapse#11690))
- Send the `Accept` header in HTTP requests made using `SimpleHttpClient.get_json`. ([\#11677](matrix-org/synapse#11677))
- Work around Mjolnir compatibility issue by adding an import for `glob_to_regex` in `synapse.util`, where it moved from. ([\#11696](matrix-org/synapse#11696))


Synapse 1.49.2 (2021-12-21)
===========================

This release fixes a regression introduced in Synapse 1.49.0 which could cause `/sync` requests to take significantly longer. This would particularly affect "initial" syncs for users participating in a large number of rooms, and in extreme cases, could make it impossible for such users to log in on a new client.

**Note:** in line with our [deprecation policy](https://matrix-org.github.io/synapse/latest/deprecation_policy.html) for platform dependencies, this will be the last release to support Python 3.6 and PostgreSQL 9.6, both of which have now reached upstream end-of-life. Synapse will require Python 3.7+ and PostgreSQL 10+.

**Note:** We will also stop producing packages for Ubuntu 18.04 (Bionic Beaver) after this release, as it uses Python 3.6.

Bugfixes
--------

- Fix a performance regression in `/sync` handling, introduced in 1.49.0. ([\#11583](matrix-org/synapse#11583))

Internal Changes
----------------

- Work around a build problem on Debian Buster. ([\#11625](matrix-org/synapse#11625))


Synapse 1.49.1 (2021-12-21)
===========================

Not released due to problems building the debian packages.


Synapse 1.49.0 (2021-12-14)
===========================

No significant changes since version 1.49.0rc1.


Support for Ubuntu 21.04 ends next month on the 20th of January
---------------------------------------------------------------

For users of Ubuntu 21.04 (Hirsute Hippo), please be aware that [upstream support for this version of Ubuntu will end next month][Ubuntu2104EOL].
We will stop producing packages for Ubuntu 21.04 after upstream support ends.

[Ubuntu2104EOL]: https://lists.ubuntu.com/archives/ubuntu-announce/2021-December/000275.html


The wiki has been migrated to the documentation website
-------------------------------------------------------

We've decided to move the existing, somewhat stagnant pages from the GitHub wiki
to the [documentation website](https://matrix-org.github.io/synapse/latest/).

This was done for two reasons. The first was to ensure that changes are checked by
multiple authors before being committed (everyone makes mistakes!) and the second
was visibility of the documentation. Not everyone knows that Synapse has some very
useful information hidden away in its GitHub wiki pages. Bringing them to the
documentation website should help with visibility, as well as keep all Synapse documentation
in one, easily-searchable location.

Note that contributions to the documentation website happen through [GitHub pull
requests](https://github.com/matrix-org/synapse/pulls). Please visit [#synapse-dev:matrix.org](https://matrix.to/#/#synapse-dev:matrix.org)
if you need help with the process!


Synapse 1.49.0rc1 (2021-12-07)
==============================

Features
--------

- Add [MSC3030](matrix-org/matrix-spec-proposals#3030) experimental client and federation API endpoints to get the closest event to a given timestamp. ([\#9445](matrix-org/synapse#9445))
- Include bundled relation aggregations during a limited `/sync` request and `/relations` request, per [MSC2675](matrix-org/matrix-spec-proposals#2675). ([\#11284](matrix-org/synapse#11284), [\#11478](matrix-org/synapse#11478))
- Add plugin support for controlling database background updates. ([\#11306](matrix-org/synapse#11306), [\#11475](matrix-org/synapse#11475), [\#11479](matrix-org/synapse#11479))
- Support the stable API endpoints for [MSC2946](matrix-org/matrix-spec-proposals#2946): the room `/hierarchy` endpoint. ([\#11329](matrix-org/synapse#11329))
- Add admin API to get some information about federation status with remote servers. ([\#11407](matrix-org/synapse#11407))
- Support expiry of refresh tokens and expiry of the overall session when refresh tokens are in use. ([\#11425](matrix-org/synapse#11425))
- Stabilise support for [MSC2918](https://github.com/matrix-org/matrix-doc/blob/main/proposals/2918-refreshtokens.md#msc2918-refresh-tokens) refresh tokens as they have now been merged into the Matrix specification. ([\#11435](matrix-org/synapse#11435), [\#11522](matrix-org/synapse#11522))
- Update [MSC2918 refresh token](https://github.com/matrix-org/matrix-doc/blob/main/proposals/2918-refreshtokens.md#msc2918-refresh-tokens) support to confirm with the latest revision: accept the `refresh_tokens` parameter in the request body rather than in the URL parameters. ([\#11430](matrix-org/synapse#11430))
- Support configuring the lifetime of non-refreshable access tokens separately to refreshable access tokens. ([\#11445](matrix-org/synapse#11445))
- Expose `synapse_homeserver` and `synapse_worker` commands as entry points to run Synapse's main process and worker processes, respectively. Contributed by @Ma27. ([\#11449](matrix-org/synapse#11449))
- `synctl stop` will now wait for Synapse to exit before returning. ([\#11459](matrix-org/synapse#11459), [\#11490](matrix-org/synapse#11490))
- Extend the "delete room" admin api to work correctly on rooms which have previously been partially deleted. ([\#11523](matrix-org/synapse#11523))
- Add support for the `/_matrix/client/v3/login/sso/redirect/{idpId}` API from Matrix v1.1. This endpoint was overlooked when support for v3 endpoints was added in Synapse 1.48.0rc1. ([\#11451](matrix-org/synapse#11451))


Bugfixes
--------

- Fix using [MSC2716](matrix-org/matrix-spec-proposals#2716) batch sending in combination with event persistence workers. Contributed by @tulir at Beeper. ([\#11220](matrix-org/synapse#11220))
- Fix a long-standing bug where all requests that read events from the database could get stuck as a result of losing the database connection, properly this time. Also fix a race condition introduced in the previous insufficient fix in Synapse 1.47.0. ([\#11376](matrix-org/synapse#11376))
- The `/send_join` response now includes the stable `event` field instead of the unstable field from [MSC3083](matrix-org/matrix-spec-proposals#3083). ([\#11413](matrix-org/synapse#11413))
- Fix a bug introduced in Synapse 1.47.0 where `send_join` could fail due to an outdated `ijson` version. ([\#11439](matrix-org/synapse#11439), [\#11441](matrix-org/synapse#11441), [\#11460](matrix-org/synapse#11460))
- Fix a bug introduced in Synapse 1.36.0 which could cause problems fetching event-signing keys from trusted key servers. ([\#11440](matrix-org/synapse#11440))
- Fix a bug introduced in Synapse 1.47.1 where the media repository would fail to work if the media store path contained any symbolic links. ([\#11446](matrix-org/synapse#11446))
- Fix an `LruCache` corruption bug, introduced in Synapse 1.38.0, that would cause certain requests to fail until the next Synapse restart. ([\#11454](matrix-org/synapse#11454))
- Fix a long-standing bug where invites from ignored users were included in incremental syncs. ([\#11511](matrix-org/synapse#11511))
- Fix a regression in Synapse 1.48.0 where presence workers would not clear their presence updates over replication on shutdown. ([\#11518](matrix-org/synapse#11518))
- Fix a regression in Synapse 1.48.0 where the module API's `looping_background_call` method would spam errors to the logs when given a non-async function. ([\#11524](matrix-org/synapse#11524))


Updates to the Docker image
---------------------------

- Update `Dockerfile-workers` to healthcheck all workers in the container. ([\#11429](matrix-org/synapse#11429))


Improved Documentation
----------------------

- Update the media repository documentation. ([\#11415](matrix-org/synapse#11415))
- Update section about backward extremities in the room DAG concepts doc to correct the misconception about backward extremities indicating whether we have fetched an events' `prev_events`. ([\#11469](matrix-org/synapse#11469))


Internal Changes
----------------

- Add `Final` annotation to string constants in `synapse.api.constants` so that they get typed as `Literal`s. ([\#11356](matrix-org/synapse#11356))
- Add a check to ensure that users cannot start the Synapse master process when `worker_app` is set. ([\#11416](matrix-org/synapse#11416))
- Add a note about postgres memory management and hugepages to postgres doc. ([\#11467](matrix-org/synapse#11467))
- Add missing type hints to `synapse.config` module. ([\#11465](matrix-org/synapse#11465))
- Add missing type hints to `synapse.federation`. ([\#11483](matrix-org/synapse#11483))
- Add type annotations to `tests.storage.test_appservice`. ([\#11488](matrix-org/synapse#11488), [\#11492](matrix-org/synapse#11492))
- Add type annotations to some of the configuration surrounding refresh tokens. ([\#11428](matrix-org/synapse#11428))
- Add type hints to `synapse/tests/rest/admin`. ([\#11501](matrix-org/synapse#11501))
- Add type hints to storage classes. ([\#11411](matrix-org/synapse#11411))
- Add wiki pages to documentation website. ([\#11402](matrix-org/synapse#11402))
- Clean up `tests.storage.test_main` to remove use of legacy code. ([\#11493](matrix-org/synapse#11493))
- Clean up `tests.test_visibility` to remove legacy code. ([\#11495](matrix-org/synapse#11495))
- Convert status codes to `HTTPStatus` in `synapse.rest.admin`. ([\#11452](matrix-org/synapse#11452), [\#11455](matrix-org/synapse#11455))
- Extend the `scripts-dev/sign_json` script to support signing events. ([\#11486](matrix-org/synapse#11486))
- Improve internal types in push code. ([\#11409](matrix-org/synapse#11409))
- Improve type annotations in `synapse.module_api`. ([\#11029](matrix-org/synapse#11029))
- Improve type hints for `LruCache`. ([\#11453](matrix-org/synapse#11453))
- Preparation for database schema simplifications: disambiguate queries on `state_key`. ([\#11497](matrix-org/synapse#11497))
- Refactor `backfilled` into specific behavior function arguments (`_persist_events_and_state_updates` and downstream calls). ([\#11417](matrix-org/synapse#11417))
- Refactor `get_version_string` to fix-up types and duplicated code. ([\#11468](matrix-org/synapse#11468))
- Refactor various parts of the `/sync` handler. ([\#11494](matrix-org/synapse#11494), [\#11515](matrix-org/synapse#11515))
- Remove unnecessary `json.dumps` from `tests.rest.admin`. ([\#11461](matrix-org/synapse#11461))
- Save the OpenID Connect session ID on login. ([\#11482](matrix-org/synapse#11482))
- Update and clean up recently ported documentation pages. ([\#11466](matrix-org/synapse#11466))
babolivier added a commit to matrix-org/synapse-dinsic that referenced this pull request Feb 7, 2022
Synapse 1.50.0 (2022-01-18)
===========================

Please note that we now only support Python 3.7+ and PostgreSQL 10+ (if applicable), because Python 3.6 and PostgreSQL 9.6 have reached end-of-life.

No significant changes since 1.50.0rc2.

Synapse 1.50.0rc2 (2022-01-14)
==============================

This release candidate fixes a federation-breaking regression introduced in Synapse 1.50.0rc1.

Bugfixes
--------

- Fix a bug introduced in Synapse v1.0.0 whereby some device list updates would not be sent to remote homeservers if there were too many to send at once. ([\#11729](matrix-org/synapse#11729))
- Fix a bug introduced in Synapse v1.50.0rc1 whereby outbound federation could fail because too many EDUs were produced for device updates. ([\#11730](matrix-org/synapse#11730))

Improved Documentation
----------------------

- Document that now the minimum supported PostgreSQL version is 10. ([\#11725](matrix-org/synapse#11725))

Internal Changes
----------------

- Fix a typechecker problem related to our (ab)use of `nacl.signing.SigningKey`s. ([\#11714](matrix-org/synapse#11714))

Synapse 1.50.0rc1 (2022-01-05)
==============================

Features
--------

- Allow guests to send state events per [MSC3419](matrix-org/matrix-spec-proposals#3419). ([\#11378](matrix-org/synapse#11378))
- Add experimental support for part of [MSC3202](matrix-org/matrix-spec-proposals#3202): allowing application services to masquerade as specific devices. ([\#11538](matrix-org/synapse#11538))
- Add admin API to get users' account data. ([\#11664](matrix-org/synapse#11664))
- Include the room topic in the stripped state included with invites and knocking. ([\#11666](matrix-org/synapse#11666))
- Send and handle cross-signing messages using the stable prefix. ([\#10520](matrix-org/synapse#10520))
- Support unprefixed versions of fallback key property names. ([\#11541](matrix-org/synapse#11541))

Bugfixes
--------

- Fix a long-standing bug where relations from other rooms could be included in the bundled aggregations of an event. ([\#11516](matrix-org/synapse#11516))
- Fix a long-standing bug which could cause `AssertionError`s to be written to the log when Synapse was restarted after purging events from the database. ([\#11536](matrix-org/synapse#11536), [\#11642](matrix-org/synapse#11642))
- Fix a bug introduced in Synapse 1.17.0 where a pusher created for an email with capital letters would fail to be created. ([\#11547](matrix-org/synapse#11547))
- Fix a long-standing bug where responses included bundled aggregations when they should not, per [MSC2675](matrix-org/matrix-spec-proposals#2675). ([\#11592](matrix-org/synapse#11592), [\#11623](matrix-org/synapse#11623))
- Fix a long-standing bug that some unknown endpoints would return HTML error pages instead of JSON `M_UNRECOGNIZED` errors. ([\#11602](matrix-org/synapse#11602))
- Fix a bug introduced in Synapse 1.19.3 which could sometimes cause `AssertionError`s when backfilling rooms over federation. ([\#11632](matrix-org/synapse#11632))

Improved Documentation
----------------------

- Update Synapse install command for FreeBSD as the package is now prefixed with `py38`. Contributed by @itchychips. ([\#11267](matrix-org/synapse#11267))
- Document the usage of refresh tokens. ([\#11427](matrix-org/synapse#11427))
- Add details for how to configure a TURN server when behind a NAT. Contibuted by @AndrewFerr. ([\#11553](matrix-org/synapse#11553))
- Add references for using Postgres to the Docker documentation. ([\#11640](matrix-org/synapse#11640))
- Fix the documentation link in newly-generated configuration files. ([\#11678](matrix-org/synapse#11678))
- Correct the documentation for `nginx` to use a case-sensitive url pattern. Fixes an error introduced in v1.21.0. ([\#11680](matrix-org/synapse#11680))
- Clarify SSO mapping provider documentation by writing `def` or `async def` before the names of methods, as appropriate. ([\#11681](matrix-org/synapse#11681))

Deprecations and Removals
-------------------------

- Replace `mock` package by its standard library version. ([\#11588](matrix-org/synapse#11588))
- Drop support for Python 3.6 and Ubuntu 18.04. ([\#11633](matrix-org/synapse#11633))

Internal Changes
----------------

- Allow specific, experimental events to be created without `prev_events`. Used by [MSC2716](matrix-org/matrix-spec-proposals#2716). ([\#11243](matrix-org/synapse#11243))
- A test helper (`wait_for_background_updates`) no longer depends on classes defining a `store` property. ([\#11331](matrix-org/synapse#11331))
- Add type hints to `synapse.appservice`. ([\#11360](matrix-org/synapse#11360))
- Add missing type hints to `synapse.config` module. ([\#11480](matrix-org/synapse#11480))
- Add test to ensure we share the same `state_group` across the whole historical batch when using the [MSC2716](matrix-org/matrix-spec-proposals#2716) `/batch_send` endpoint. ([\#11487](matrix-org/synapse#11487))
- Refactor `tests.util.setup_test_homeserver` and `tests.server.setup_test_homeserver`. ([\#11503](matrix-org/synapse#11503))
- Move `glob_to_regex` and `re_word_boundary` to `matrix-python-common`. ([\#11505](matrix-org/synapse#11505), [\#11687](matrix-org/synapse#11687))
- Use `HTTPStatus` constants in place of literals in `tests.rest.client.test_auth`. ([\#11520](matrix-org/synapse#11520))
- Add a receipt types constant for `m.read`. ([\#11531](matrix-org/synapse#11531))
- Clean up `synapse.rest.admin`. ([\#11535](matrix-org/synapse#11535))
- Add missing `errcode` to `parse_string` and `parse_boolean`. ([\#11542](matrix-org/synapse#11542))
- Use `HTTPStatus` constants in place of literals in `synapse.http`. ([\#11543](matrix-org/synapse#11543))
- Add missing type hints to storage classes. ([\#11546](matrix-org/synapse#11546), [\#11549](matrix-org/synapse#11549), [\#11551](matrix-org/synapse#11551), [\#11555](matrix-org/synapse#11555), [\#11575](matrix-org/synapse#11575), [\#11589](matrix-org/synapse#11589), [\#11594](matrix-org/synapse#11594), [\#11652](matrix-org/synapse#11652), [\#11653](matrix-org/synapse#11653), [\#11654](matrix-org/synapse#11654), [\#11657](matrix-org/synapse#11657))
- Fix an inaccurate and misleading comment in the `/sync` code. ([\#11550](matrix-org/synapse#11550))
- Add missing type hints to `synapse.logging.context`. ([\#11556](matrix-org/synapse#11556))
- Stop populating unused database column `state_events.prev_state`. ([\#11558](matrix-org/synapse#11558))
- Minor efficiency improvements in event persistence. ([\#11560](matrix-org/synapse#11560))
- Add some safety checks that storage functions are used correctly. ([\#11564](matrix-org/synapse#11564), [\#11580](matrix-org/synapse#11580))
- Make `get_device` return `None` if the device doesn't exist rather than raising an exception. ([\#11565](matrix-org/synapse#11565))
- Split the HTML parsing code from the URL preview resource code. ([\#11566](matrix-org/synapse#11566))
- Remove redundant `COALESCE()`s around `COUNT()`s in database queries. ([\#11570](matrix-org/synapse#11570))
- Add missing type hints to `synapse.http`. ([\#11571](matrix-org/synapse#11571))
- Add [MSC2716](matrix-org/matrix-spec-proposals#2716) and [MSC3030](matrix-org/matrix-spec-proposals#3030) to `/versions` -> `unstable_features` to detect server support. ([\#11582](matrix-org/synapse#11582))
- Add type hints to `synapse/tests/rest/admin`. ([\#11590](matrix-org/synapse#11590))
- Drop end-of-life Python 3.6 and Postgres 9.6 from CI. ([\#11595](matrix-org/synapse#11595))
- Update black version and run it on all the files. ([\#11596](matrix-org/synapse#11596))
- Add opentracing type stubs and fix associated mypy errors. ([\#11603](matrix-org/synapse#11603), [\#11622](matrix-org/synapse#11622))
- Improve OpenTracing support for requests which use a `ResponseCache`. ([\#11607](matrix-org/synapse#11607))
- Improve OpenTracing support for incoming HTTP requests. ([\#11618](matrix-org/synapse#11618))
- A number of improvements to opentracing support. ([\#11619](matrix-org/synapse#11619))
- Refactor the way that the `outlier` flag is set on events received over federation. ([\#11634](matrix-org/synapse#11634))
- Improve the error messages from  `get_create_event_for_room`. ([\#11638](matrix-org/synapse#11638))
- Remove redundant `get_current_events_token` method. ([\#11643](matrix-org/synapse#11643))
- Convert `namedtuples` to `attrs`. ([\#11665](matrix-org/synapse#11665), [\#11574](matrix-org/synapse#11574))
- Update the `/capabilities` response to include whether support for [MSC3440](matrix-org/matrix-spec-proposals#3440) is available. ([\#11690](matrix-org/synapse#11690))
- Send the `Accept` header in HTTP requests made using `SimpleHttpClient.get_json`. ([\#11677](matrix-org/synapse#11677))
- Work around Mjolnir compatibility issue by adding an import for `glob_to_regex` in `synapse.util`, where it moved from. ([\#11696](matrix-org/synapse#11696))
MadLittleMods added a commit to matrix-org/complement that referenced this pull request Feb 25, 2022
During the development of matrix-org/synapse#11243
we added a `org.matrix.msc2716v4` room version but it's no longer necessary
and was removed in matrix-org/synapse@e2928b5
MadLittleMods added a commit to matrix-org/complement that referenced this pull request Feb 25, 2022
During the development of matrix-org/synapse#11243
we added a `org.matrix.msc2716v4` room version but it's no longer necessary
and was removed in matrix-org/synapse@e2928b5
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants